package com.example.chcrm.entity.common;

import com.baomidou.mybatisplus.annotation.*;
import com.fasterxml.jackson.annotation.JsonFormat;
import lombok.Data;
import lombok.EqualsAndHashCode;
import lombok.experimental.Accessors;
import org.jeecgframework.poi.excel.annotation.Excel;

import javax.validation.constraints.NotBlank;
import javax.validation.constraints.NotNull;
import java.io.Serializable;
import java.math.BigDecimal;
import java.util.Date;
import java.util.List;

/**
 * @Author 邹
 * @Date 2025/4/23 13:13
 * @Version 1.0
 */
@Data
@EqualsAndHashCode(callSuper = false)
@Accessors(chain = true)
public class LineConfig implements Serializable {
    private static final long serialVersionUID = 1L;

    @TableId(value = "id",type = IdType.INPUT)
    private String id;
    @TableField(exist = false)
    private Integer sortOrder;  //子路线排序
    @NotBlank(message = "线路名称不能为空")
    @Excel(name = "线路名称",width = 20)
    private String lineName;    //线路名称
    @NotNull(message = "线路类型不能为空")
    private Integer lineType;   //线路类型 1公路 2水路



    @NotBlank(message = "起始区域id不能为空")
    private String startAddressId;      //起始地id
    private String startFullAddressId;  //起始地Id（包含父级）
    private String startAddressName;    //起始地名称(包含父级)
    private String startAddrName;       //起始地名称(不包含父级)
    private String startingCoordinate;  //起始地坐标

    @NotBlank(message = "目的区域id不能为空")
    private String endAddressId;        //目的地id
    private String endFullAddressId;    //目的地Id（包含父级）
    private String endAddressName;      //目的地名称(包含父级)
    private String endAddrName;         //目的地名称(不包含父级)
    private String deliveryCoordinate;  //交车地坐标

    @TableField(updateStrategy = FieldStrategy.IGNORED)
    private String departurePortId;     //起运港id
    @TableField(updateStrategy = FieldStrategy.IGNORED)
    private String departurePort;       //起运港名
    @TableField(updateStrategy = FieldStrategy.IGNORED)
    private String arrivePortId;        //到达港id
    @TableField(updateStrategy = FieldStrategy.IGNORED)
    private String arrivePort;          //到达港名

    private Integer status;             //状态 1 启用 0禁用
    @TableField(fill = FieldFill.INSERT)
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss",timezone = "GMT+8")
    private Date createTime;        //创建时间
    @TableLogic(value = "0",delval = "-1")
    private Integer isDeleted;      //逻辑删除 0否 -1是
    @TableField(exist = false)
    @Excel(name = "距离")
    private Integer distanceExport;
    @TableField(exist = false)
    @Excel(name = "耗时")
    private String estimateTimeExport;
    @TableField(exist = false)
    @Excel(name = "起始地",width = 30)
    private String staterAddressExport;
    @TableField(exist = false)
    @Excel(name = "目的地",width = 30)
    private String endAddressExport;
    @TableField(exist = false)
    @Excel(name = "线路类型")
    private String lineTypeExport;
    @TableField(exist = false)
    @Excel(name = "状态")
    private String statusExport;

    @TableField(exist = false)
    private Integer page = 1;
    @TableField(exist = false)
    private Integer rows = 10;
    /**
     * 操作记录
     */
    @TableField(exist = false)
    private List<OperateRecord> operateRecordList;
}
